package com.czkt.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.czkt.entity.CstLost;
import com.czkt.service.ICstLostService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@Controller
public class LostRptController {

    @Resource
    ICstLostService cstLostService;

    @RequestMapping("/lostRpt/list")
    public String cstLostShow(@RequestParam(value = "lstCustName",defaultValue = "") String lstCustName,
                              @RequestParam(value = "lstCustManagerName",defaultValue = "") String lstCustManagerName,
                              @RequestParam(value = "pageIndex",defaultValue = "1") Integer pageIndex,
                              @RequestParam(defaultValue = "3") Integer pageSize, Model model){
        IPage<CstLost> cstLostIPage = cstLostService.selectCstLost(lstCustName,lstCustManagerName,pageIndex,pageSize);
        model.addAttribute("rolePage",cstLostIPage);
        model.addAttribute("lstCustName",lstCustName);
        model.addAttribute("lstCustManagerName",lstCustManagerName);
        return "/lostRpt/list";
    }
}
